<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<f:view>
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<html>
	<head>
	<base href="<%=basePath%>">

	<title>企业信息管理系统 - 短消息管理</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="企业,信息,管理">
	<meta http-equiv="description" content="企业信息管理系统 - 短消息管理">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<link rel="stylesheet" type="text/css" href="css/styles.css">

	</head>
	<body>
	<div align="center">

	<table height="100%" width="100%" border="0" cellspacing="0"
		cellpadding="0">
		<tr>
			<td colspan="2" height="108">
			<table height="108" background="images/banner.jpg" border="0"
				cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td></td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td width="160" bgcolor="#EEEEEE" valign="top" height="100%"><%@ include
				file="inc/menu.jsp"%></td>
			<td align="left" valign="top"><h:form>
				<TABLE width="100%" class="position">
					<TR>
						<TD>当前位置：短消息管理</TD>
						<TD align="right"><h:commandLink value="发送消息"
							action="#{smsAction.add}" /></TD>
						<TD width="20"></TD>
					</TR>
				</TABLE>


				<h:dataTable value="#{smsAction.list}" var="hash"
					headerClass="tableheader" width="100%">
					<h:column>
						<f:facet name="header">
							<h:outputText value="发送者" />
						</f:facet>
						<h:outputText value="#{hash.sender}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="消息内容" />
						</f:facet>
						<h:outputText value="#{hash.message}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="接收者" />
						</f:facet>
						<h:outputText value="#{hash.username}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="是否阅读" />
						</f:facet>
						<h:outputText value="#{hash.isRead}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="操作" />
						</f:facet>
						<h:commandLink value="设置已读" action="#{smsAction.read}">
							<f:param name="id" value="#{hash.id}" />
						</h:commandLink>
						<h:commandLink value="删除" action="#{smsAction.delete}">
							<f:param name="id" value="#{hash.id}" />
						</h:commandLink>
					</h:column>
				</h:dataTable>

				<h:panelGrid styleClass="pager" width="100%" columns="3">
					<h:panelGroup style="text-align:left;">
						<h:outputText value="每页记录数：" />
						<h:selectOneMenu value="#{smsAction.pageSize}"
							valueChangeListener="#{smsAction.changePageSize}"
							immediate="true" onchange="this.form.submit();">
							<f:selectItems value="#{smsAction.pageSizeItems}" />
						</h:selectOneMenu>
					</h:panelGroup>
					<h:panelGroup style="text-align:center;">
						<h:outputText value="总记录数：" />
						<h:outputText value="#{smsAction.rowCount}" />
					</h:panelGroup>
					<h:panelGroup layout="block"
						style="text-align:right; margin-right: 10px;">
						<h:commandLink value="首页" action="#{smsAction.list}">
							<f:param name="pageNo" value="#{smsAction.pageFirstNo}" />
						</h:commandLink>&nbsp;<h:commandLink value="前一页" action="#{smsAction.list}">
							<f:param name="pageNo" value="#{smsAction.pagePreNo}" />
						</h:commandLink>&nbsp;<h:commandLink value="后一页" action="#{smsAction.list}">
							<f:param name="pageNo" value="#{smsAction.pageNextNo}" />
						</h:commandLink>&nbsp;<h:commandLink value="尾页" action="#{smsAction.list}">
							<f:param name="pageNo" value="#{smsAction.pageLastNo}" />
						</h:commandLink>&nbsp;<h:selectOneMenu value="#{smsAction.pageNo}"
							immediate="true" valueChangeListener="#{smsAction.changePageNo}"
							onchange="this.form.submit();">
							<f:selectItems value="#{smsAction.pageNoItems}" />
						</h:selectOneMenu>
					</h:panelGroup>
				</h:panelGrid>

				<h:messages />


			</h:form></td>
		</tr>
		<tr>
			<td colspan="2" align="center"><%@ include file="inc/foot.jsp"%>
			</td>
		</tr>
	</table>
	</div>
	</body>
	</html>
</f:view>